﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Asion.Dapper
{
    /// <summary>
    /// 数据提供者
    /// </summary>
    public abstract class DbProvider
    {
        public abstract DbProviderFactory Factory { get; }

        public virtual void Dispose() { }


        public DbConnection GetConnection(string connectionString)
        {
            var conn = Factory.CreateConnection()!;
            conn.ConnectionString = connectionString;
            return conn;
        }
    }
}
